﻿using NUnit.Framework;
using WatiN.Core;

namespace googleSearch
{
    [TestFixture]
    [RequiresSTA]
    public class VerifyClass
    {
        [Test]
        public void GoogleSearchVerify()
        {
                //for (int i = 0; i < 10;i++ )
                //{} 
                    //using ()
                  //  { 
            var ie = new IE();
            ie.ClearCache();
            ie.ClearCookies();
            ie.GoTo("www.baidu.com");

            ie.WaitForComplete();
            ie.TextField(Find.ByName("wd")).TypeText("gaga");
            //ie.Button(Find.ById("su")).Click();
            
            System.Threading.Thread.Sleep(200);
            //ie.Button(Find.ByName("btnG")).Click();
            //Assert.IsTrue(ie.ContainsText("WatiN2"));
            ie.CaptureWebPageToFile(@"D:\Code\Tool\googleSearch_Watin\googleSearch\bin\Debug\Capture\a.jpg");
            ie.Close();
           // }
        }

        [Test]
        public void GoogleSearchVerify2()
        {
            //for (int i = 0; i < 10;i++ )
            //{} 
            //using ()
            //  { 
            var ie = new IE();
            ie.ClearCache();
            ie.ClearCookies();
            ie.GoTo("www.baidu.com");
            ie.WaitForComplete();
            ie.TextField(Find.ByName("wd")).TypeText("dog");
            //ie.Button(Find.ById("su")).Click();

            System.Threading.Thread.Sleep(200);
            //ie.Button(Find.ByName("btnG")).Click();
            //Assert.IsTrue(ie.ContainsText("WatiN2"));
            ie.CaptureWebPageToFile(@"D:\Code\Tool\googleSearch_Watin\googleSearch\bin\Debug\Capture\b.jpg");
            // }
            ie.Close();
        }
        

    }
}
